<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="verydows-baseurl" content="<{$common.baseurl}>">
<title>我的收藏 - <{$GLOBALS.cfg.site_name}></title>
<link rel="stylesheet" type="text/css" href="<{$common.theme}>/css/general.css" />
<link rel="stylesheet" type="text/css" href="<{$common.theme}>/css/user.css" />
<script type="text/javascript" src="<{$common.baseurl}>/public/script/jquery.js"></script>
<script type="text/javascript" src="<{$common.theme}>/js/general.js"></script>
<script type="text/javascript">
function checkAllFav(){
  if($('#checkallbtn').prop('checked')){
    $('#favlist').find('input[type="checkbox"]').prop('checked', true);
  }else{
    $('#favlist').find('input[type="checkbox"]').prop('checked', false);
  }
}

function deleteFav(btn, id){
  $(btn).vdsConfirm({
    text: '您确定要删除吗?',
    left: -20,
    top: -25,
    ok: function(){
      window.location.href = "<{url c='favorite' a='delete' goods_id='"+id'}>;
    }
  });
}

function deleteMultFav(){
  if($('#favlist').find('input[type="checkbox"]:checked').size() > 0){
    $('#favlist form').submit();
  }else{
    $.vdsPopDialog({type:'err', text:'请先选中收藏的商品'});
  }
}
</script>
</head>
<body>
<!-- 顶部开始 -->
<{layout_topper common=$common}>
<!-- 顶部结束 -->
<!-- 头部开始 -->
<{layout_header common=$common}>
<!-- 头部结束 -->
<div class="loc w1100">
  <div><a href="<{url c='main' a='index'}>">网站首页</a><b>&gt;</b><font>我的收藏</font></div>
</div>
<!-- 主体开始 -->
<div class="container w1100 mt10">
  <div class="module cut">
    <!-- 左侧开始 -->
    <div class="w180 fl cut">
      <!-- 用户菜单开始 -->
      <{layout_usermenu}>
      <!-- 用户菜单结束 -->
    </div>
    <!-- 左侧结束 -->
    <!-- 右侧开始 -->
    <div class="w910">
      <div class="mcter">
        <h2>我的收藏</h2>
        <{if !empty($favorites.list)}>
        <div class="udatali favorite cut">
          <div class="tli cut" id="favlist">
            <form method="post" action="<{url c='favorite' a='delete'}>">
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <th colspan="3">商品</th>
                  <th width="15%">收藏时间</th>
                  <th width="25%">操作</th>
                </tr>
                <{foreach $favorites.list as $v}>
                <tr>
                  <td width="20"><input type="checkbox" name="goods_id[]" value="<{$v.goods_id}>" /></td>
                  <td><a href="<{url c='goods' a='index' id=$v.goods_id}>"><img src="<{$common.baseurl}>/upload/goods/prime/50x50/<{$v.goods_image}>" /></a></td>
                  <td>
                    <p class="aln-l"><a href="<{url c='goods' a='index' id=$v.goods_id}>"><{$v.goods_name}></a></p>
                    <p class="aln-l red mt5"><font class="cny">¥</font> <{$v.now_price}></p>
                  </td>
                  <td>
                    <{date('Y-m-d', $v.created_date)}><br />
                    <{date('H:i:s', $v.created_date)}>
                  </td>
                  <td><p class="actrow"><a class="red-btn pointer" onclick="deleteFav(this, <{$v.goods_id}>)">删除</a></p></td>
                </tr>
                <{/foreach}>
              </table>
            </form>
          </div>
          <div class="doact mt10">
            <label class="mr10" onclick="checkAllFav()"><input type="checkbox" class="vln-m" id="checkallbtn" /><font class="ml5 c666">全选</font></label>
            <button type="button" class="sm-gen rad3btn" onclick="deleteMultFav()">删除</button>
          </div>
          <{if !empty($favorites.paging)}>
          <!-- 页码开始 -->
          <div class="module aln-c mt10 cut"><{layout_paging paging=$favorites.paging class='paging small' c='favorite' a='list'}></div>
          <!-- 页码结束 -->
          <{/if}>
        </div>
        <{else}>
        <div class="pad10 aln-c caaa">暂无商品收藏记录</div>
        <{/if}>
      </div>
    </div>
    <!-- 右侧结束 -->
  </div>
  <div class="cl"></div>
  <{layout_helper}>
</div>
<!-- 主体结束 -->
<div class="cl"></div>
<!-- 页脚开始 -->
<{layout_footer}>
<!-- 页脚结束 -->
<script type="text/javascript" src="<{$common.baseurl}>/public/script/juicer.js"></script>
</body>
</html>